///*
// * To change this template, choose Tools | Templates
// * and open the template in the editor.
// */
//package com.techhighteam675.robot2012;
//
//import com.sun.squawk.util.MathUtils;
//
////i think this is the location of the C natives
//import com.sun.cldc.jna.NativeLibrary;
//import edu.wpi.first.wpilibj.camera.AxisCamera;
//import edu.wpi.first.wpilibj.image.BinaryImage;
//import edu.wpi.first.wpilibj.image.ColorImage;
//import edu.wpi.first.wpilibj.image.Image;
//import edu.wpi.first.wpilibj.image.ParticleAnalysisReport;
//import java.util.Vector;
//
///**
// *
// * @author Lena Eiger (and Noah Picard, briefly)
// */
//class TargetTracker2012 {
//        public TargetTracker2012() {
//            camera = AxisCamera.getInstance();
//
//            System.out.println("Setting camera parameters");
//            //camera->WriteResolution(AxisCamera::kResolution_320x240);
//            System.out.println("camera initalized");
//
//            //NativeLibrary.getDefaultInstance().getFunction
//        }
//
//	private Target[] targets = new Target[4];
//	private AxisCamera camera;
//	private BinaryImage binImage;
//	private int imgWidth, imgHeight; //width and height of the camera image in pixels
//	private int targetMode;
//	private int confidence;
//	/*
//	private void createTarget(ParticleAnalysisReport *report, Target.targetPosition position);
//
//	private double getAzimuthFromWidth(Target.targetPosition targPos);
//	private double getHorizAngle(int _pixelX, int _pixelY);
//	private double getVertAngle(int _pixelX, int _pixelY);
//	private void getDistAndHeight(ParticleAnalysisReport &target, double &_dist, double &_height);
//	private double getDist(double _height, double _angle);
//	private void getTargets(vector<ParticleAnalysisReport>  particles);
//	private static double getTargetX(Target.targetPosition targPos);
//	private static double getTargetY(Target.targetPosition targPos);
//        */
//
//    LaunchInfo update(int targetPos, boolean swish) {
//	LaunchInfo launchInfo = new LaunchInfo();
//	if(camera.freshImage())
//        {
//		System.out.println("camera is fresh");
//
//                Vector particles = new Vector();
//                ParticleAnalysisReport[] temp = new ParticleAnalysisReport[0];
//
//                try
//                {
//                    binImage = processImage();
//                    temp = binImage.getOrderedParticleAnalysisReports();
//                }
//                catch(Exception e)
//                {
//                    e.printStackTrace();
//                }
//
//                for(int n = 0; n < temp.length; n++)
//                {
//                    particles.addElement(temp[n]);
//                }
//		getTargets(particles);
//		Position robotPos = getRobotPosition();
//		if(robotPos.x != 0 || robotPos.z != 0) {
//			launchInfo = getLaunchVelocity(robotPos, targetPos, swish);
//		}
//		launchInfo.Print();
//	}
//
//	return launchInfo;
//}
//
//LaunchInfo update(int targetLevel) {
//	return update(targetLevel, true);
//}
//
//LaunchInfo update() {
//	return update(Target.TARGET_TOP);
//}
//
//BinaryImage processImage() throws Exception{
//	ColorImage img = camera.getImage();
//	imgWidth = img.getWidth();
//	imgHeight = img.getHeight();
//	BinaryImage output = img.thresholdRGB(
//                /*
//                 * May be in the wrong order ############################################################
//                 */
//                Definitions.TARGET_COLOR_THRESHOLD_R_MIN,
//                Definitions.TARGET_COLOR_THRESHOLD_R_MAX,
//                Definitions.TARGET_COLOR_THRESHOLD_G_MIN,
//                Definitions.TARGET_COLOR_THRESHOLD_G_MAX,
//                Definitions.TARGET_COLOR_THRESHOLD_B_MIN,
//                Definitions.TARGET_COLOR_THRESHOLD_B_MAX
//                );
//
//	Image imaqImage = output.getImaqImage();
//
//	//remove small particles
//	int pKernel[] = {1,1,1,1,1,1,1,1,1};
//	StructuringElement structElem = new StructuringElement();
//	structElem.matrixCols = 3;
//	structElem.matrixRows = 3;
//	structElem.hexa = false;
//	structElem.kernel = pKernel;
//	imaqSizeFilter(imaqImage,imaqImage,true, 1, IMAQ_KEEP_LARGE, structElem);
//
//	//convex hull
//        //output.convexHull(boolean);
//	imaqConvexHull(imaqImage,imaqImage, true);
//
//	return output;
//}
//
//double getAzimuthFromWidth(int targPos) //PHI IS ALWAYS POSITIVE!!!!!!!!!!!!
//{
//	Position robotPos;
//	Target target = targets[targPos];
//	double theta = target.targetAngleWidth;
//	double phi; // real value
//	double phi1;
//	double phi2;
//	double G = Definitions.TARGET_WIDTH / target.distance;
//	double H = G * G;
//	double U = Math.tan(theta / 2);
//	double A = H * U * U * U * U;
//	double B = -2 * (U * U) * (H + 2);
//	double C = H - (4 * U * U);
//
//	double result1 = MathExtension.SolveSecondDegree(A,B,C,true);
//	double result2 = MathExtension.SolveSecondDegree(A,B,C,false);
//	phi1 = MathUtils.atan(Math.sqrt(result1));
//	phi2 = MathUtils.atan(Math.sqrt(result2));
//
//	//result one
//	double test1 =  Math.cos(phi1) * (Math.tan(phi1 + theta/2) - Math.tan(phi1 - theta / 2));
//	double test2 =  Math.cos(phi2) * (Math.tan(phi2 + theta/2) - Math.tan(phi2 - theta / 2));
//
//	if (Math.abs(test1 - G) > Math.abs(test2 - G))
//	{
//            phi = phi2;
//	}
//	else
//	{
//            phi = phi1;
//	}
//
//	return phi;
//}
//
//
//
///*double TargetTracker2012::getHorizAngle(int pixelX, int pixelY) {
//	pixelX -= imgWidth/2;
//	pixelY = imgHeight/2 - pixelY;
//	double pixelR =Math.sqrt(pixelX*pixelX+pixelY*pixelY);
//	double scaleFactor = 1 - 0.000626*pixelR + 0.00000645*pixelR*pixelR;
//	double xPixel = scaleFactor*pixelX;
//	double radPerPixel =.0025;
//	double angle = atan(xPixel * radPerPixel);
//	angle += RADIANS_PER_DEGREE * HORIZONTAL_CAMERA_ANGLE_OFFSET;
//	return angle;
//}
//
//double TargetTracker2012::getVertAngle(int pixelX, int pixelY) {
//	pixelX -= imgWidth/2;
//	pixelY = imgHeight/2 - pixelY;
//	double pixelR =Math.sqrt(pixelX*pixelX+pixelY*pixelY);
//	double scaleFactor = 1 - 0.000626*pixelR + 0.00000645*pixelR*pixelR;
//	double yPixel = scaleFactor * pixelY;
//	double radPerPixel = .0025;
//	double angle = atan(yPixel * radPerPixel);
//	angle += RADIANS_PER_DEGREE * VERTICAL_CAMERA_ANGLE_OFFSET;
//	return angle;
//}*/
//
//double getHorizAngle(int pixelX, int pixelY) {
//	double angle = MathUtils.atan((2.0 * pixelX / imgWidth - 1) * Math.tan(Math.toDegrees(Definitions.HORIZONTAL_FOV / 2)));
//	angle += Math.toDegrees(Definitions.HORIZONTAL_CAMERA_ANGLE_OFFSET);
//	return angle;
//}
//
//double getVertAngle(int pixelX, int pixelY) {
//	double angle = MathUtils.atan((1 - 2.0 * pixelY / imgHeight) * Math.tan(Math.toRadians(Definitions.VERTICAL_FOV / 2)));
//	angle += Math.toDegrees(Definitions.VERTICAL_CAMERA_ANGLE_OFFSET);
//	return angle;
//}
//
//double getDist(double _height, double _angle) {
//	return (_height - Definitions.CAMERA_HEIGHT)/ Math.tan(_angle);
//}
//
//void getDistAndHeight(ParticleAnalysisReport target, double dist, double height) {
//        /*
//         doubles need to be passed by reference##################################################################
//         */
//
//	//Rect rect = target.boundingRect;
//	double tanBottomAngle = Math.tan(getVertAngle(target.center_mass_x, target.boundingRectTop + target.boundingRectHeight));
//	double tanTopAngle = Math.tan(getVertAngle(target.center_mass_x, target.boundingRectTop));
//	height = Definitions.TARGET_HEIGHT * tanBottomAngle / (tanTopAngle - tanBottomAngle);
//	dist = height / tanBottomAngle; //distance along the floor
//	height += Definitions.TARGET_HEIGHT/2 + Definitions.CAMERA_HEIGHT; //make height correspond to the middle of the target
//	//System.out.println("bA:%1f",tanBottomAngle);
//}
//
//
//void getTargets(Vector particles){
//	ParticleAnalysisReport left, right, top, bottom;
//	left = right = top = bottom = null;
//	int targets = 0;
//	double thresholdArea = ((ParticleAnalysisReport)particles.elementAt(0)).particleArea / 2;
//	for (int i = 0;i < particles.size(); i++) {
//		double  height = 0, dist = 0;
//		if (((ParticleAnalysisReport)particles.elementAt(i)).particleArea < thresholdArea) {
//			break;
//		}
//		targets++;
//		getDistAndHeight((ParticleAnalysisReport)particles.elementAt(0), dist, height);
//		//System.out.println("<h: %4.1f, d1 %4.1f> ",height, dist);
//		if(bottom == null && height < Definitions.TARGET_BOT_Y + Definitions.TARGET_H_MAX_ERR &&
//                        height > Definitions.TARGET_BOT_Y - Definitions.TARGET_H_MAX_ERR)
//                {
//			//System.out.println("bottom ");
//			bottom = (ParticleAnalysisReport)particles.elementAt(i);
//		}
//		else if(height < Definitions.TARGET_MID_Y + Definitions.TARGET_H_MAX_ERR &&
//                        height > Definitions.TARGET_MID_Y - Definitions.TARGET_H_MAX_ERR) {
//			//System.out.println("middle ");
//			if(left == null)
//                        {
//				left = (ParticleAnalysisReport)particles.elementAt(i); //switch these later if necissary
//                        }
//			else if(right == null)
//                        {
//				right = (ParticleAnalysisReport)particles.elementAt(i);
//                        }
//		}
//		else if(top == null && height < Definitions.TARGET_TOP_Y + Definitions.TARGET_H_MAX_ERR &&
//                        height > Definitions.TARGET_TOP_Y - Definitions.TARGET_H_MAX_ERR) {
//			//System.out.println("top ");
//			top = (ParticleAnalysisReport)particles.elementAt(i);
//		}
//	}
//
//	//System.out.println("%d targets %d particles ", targets, particles.size());
//
//	if (right != null) //both mid-level targets are found
//	{
//		if (left.center_mass_x > right.center_mass_x) //if left is right of left, swich
//		{
//			ParticleAnalysisReport temp;
//			temp = left;
//			left = right;
//			right = temp;
//			//System.out.println(" left and right targets switched");
//		}
//	}
//	else if(left != null) { //one mid level target
//		if(bottom != null && bottom.center_mass_x < left.center_mass_x) {
//			right = left;
//			left = null;
//			//System.out.println(" left is right");
//		}
//		else if(top != null && top.center_mass_x < left.center_mass_x)
//		{
//			right = left;
//			left = null;
//			//System.out.println(" left is right");
//		}
//
//	}
//	createTarget(bottom,Target.TARGET_BOTTOM);
//	createTarget(left,Target.TARGET_LEFT);
//	createTarget(right,Target.TARGET_RIGHT);
//	createTarget(top,Target.TARGET_TOP);
//}
//
//void createTarget(ParticleAnalysisReport report, int position)
//{
//	Target target = targets[position];
//	target.position = position;
//	//Rect rect = report.boundingRect;
//
//	if(report == null) {
//		target.initialized = false;
//	}
//	else {
//
//		target.report = report;
//		target.initialized = true;
//
//		int cmy = report.center_mass_y;
//		int cmx = report.center_mass_x;
//
//		//calculate distance
//		if(position == Target.TARGET_TOP)
//                {
//			target.distance = getDist(Definitions.TARGET_TOP_Y,getVertAngle(cmx, report.boundingRectTop + report.boundingRectHeight/2));//rect.top+rect.height/2));
//                }
//		if(position == Target.TARGET_LEFT || position == Target.TARGET_RIGHT)
//                {
//			target.distance =  getDist(Definitions.TARGET_MID_Y ,getVertAngle(cmx, report.boundingRectTop + report.boundingRectHeight/2));
//                }
//		if(position == Target.TARGET_BOTTOM)
//                {
//			target.distance =  getDist(Definitions.TARGET_BOT_Y ,getVertAngle(cmx, report.boundingRectTop + report.boundingRectHeight/2));
//                }
//
//		//calculate azimuth
//		target.targetAngleWidth  = getHorizAngle(report.boundingRectLeft + report.boundingRectWidth,cmy) - getHorizAngle(report.boundingRectLeft,cmy);
//		double az = getAzimuthFromWidth(target.position);
//		double result = 0;
//		imaqMeasureParticle(binImage.GetImaqImage(), report.particleIndex, 0, IMAQ_MT_ORIENTATION, result);
//		if(result < 90)
//                {
//			az = -az;
//                }
//		target.azimuth = az;
//
//		//calculate camera angle
//		target.cameraAngle = getHorizAngle(report.boundingRectLeft + report.boundingRectWidth/2, cmy);
//	}
//	target.print();
//	//System.out.println("va: %2.1f", DEGREES_PER_RADIAN * getVertAngle(report->center_mass_x, rect.top+rect.height/2));
//}
//
//
//Position getRobotPosition()
//{
//	Vector positions = null;
//
//	for (int a = 0; a < Definitions.TARGET_COUNT; a++) // colect results
//	{
//		if (!targets[a].initialized)
//                {
//			continue;
//                }
//
//		positions.addElement(getRobotPosition(targets[a].position));
//
//		for (int b = 0; b < Definitions.TARGET_COUNT; b++)
//		{
//			if (!targets[b].initialized)
//                        {
//				continue;
//                        }
//			if (getTargetX(targets[a].position) == getTargetX(targets[b].position))
//                        {
//				continue;
//                        }
//
//			positions.addElement(getRobotPosition(targets[a].position,targets[b].position));
//		}
//	}
//
//	confidence = (int)positions.size() * 5;
//
//	Position firstAverage = null;
//	if (positions.isEmpty())
//	{
//
//		//System.out.println("NO TARGETS");
//		return firstAverage; // set to zero
//	}
//
//	System.out.println("postions: " + positions.size());
//	Vector validatedPositions = null;
//
//	for (int a = 0; a < positions.size(); a ++ ) // initalial average
//	{
//		firstAverage.x += ((Position)positions.elementAt(a)).x;
//		firstAverage.z += ((Position)positions.elementAt(a)).z;
//	}
//
//	firstAverage.x /= positions.size();
//	firstAverage.z /= positions.size(); // set return pos to the average
//
//	for (int a = 0; a < positions.size(); a ++ )
//	{
//		((Position)positions.elementAt(a)).SetError(firstAverage);
//	} // set error
//
//	boolean change = true;
//	while(change) // order the targets
//	{
//		change = false;
//		for (int a = 0; a < positions.size() - 1; a ++ )
//		{
//			if (((Position)positions.elementAt(a)).error > ((Position)positions.elementAt(a+1)).error)
//			{
//				change = true;
//				Position temp = ((Position)positions.elementAt(a));
//				positions.setElementAt(positions.elementAt(a), a+1);
//				positions.setElementAt(temp, a+1);
//			}
//		}
//	}
//
//
//	int newSize = (int)Math.ceil((positions.size() + 1)/2);
//	positions.setSize(newSize);
//
//	Position returnPos = null;
//
//
//	for (int a = 0; a < positions.size(); a ++ )
//	{
//		returnPos.x += ((Position)positions.elementAt(a)).x;
//		returnPos.z += ((Position)positions.elementAt(a)).z;
//	}
//
//
//	returnPos.x /= positions.size();
//	returnPos.z /= positions.size(); // set return pos to the average
//
//
//	//confidence -= abs(firstAverage.x - returnPos.x);
//
//	//System.out.println("avg: " );
//	//returnPos.Print();
//
//	//robotPos = getRobotPosition(Target::TARGET_LEFT, Target::TARGET_BOTTOM);
//	//robotPos.Print();
//
//	return returnPos;//positions.front();
//}
//
//Position getRobotPosition(int targPos1, int targPos2)
//{
//	Target target1 = targets[targPos1];
//	Target target2 = targets[targPos2];
//	Position position = null;
//	if (getTargetX(targPos1) != getTargetX(targPos2))
//	{
//		double dist1 = target1.distance;
//		double dist2 = target2.distance;
//		double angleDiff = target2.cameraAngle - target1.cameraAngle;
//		double xDiff = getTargetX(targPos2) - getTargetX(targPos1);
//		//improve target1's azimuth
//		target1.azimuth = MathUtils.acos(dist2*Math.sin(angleDiff) / xDiff);
//		if(target1.azimuth != target1.azimuth)
//			target1.azimuth = 0; // check for infinites,negative square roots and other gargbage
//		//else if(dist2 )
//
////		double z = dist1 * dist2 * sin(angleDiff) / xDiff;
////		double x = 0;
////		if(dist1 > z)// && dist1 > dist2)
////			x =Math.sqrt(dist1*dist1 - z*z);
////		else if(dist2 > z)
////			x =Math.sqrt(dist2*dist2 - z*z) - xDiff;
//
//		//double alpha = asin(dist1*sin(angleDiff)/xDiff) * DEGREES_PER_RADIAN;
//		//double beta = asin(dist2*sin(angleDiff)/xDiff) * DEGREES_PER_RADIAN;
//		double x = Math.sin(target1.azimuth) * dist1;
//		double z = Math.cos(target1.azimuth) * dist1;
//		//System.out.println("d1:%.1f d2: %.1f a:%.1f az: %.0f",dist1, dist2, angleDiff * DEGREES_PER_RADIAN,
//				//target1.azimuth * DEGREES_PER_RADIAN);
//		position.x = x;
//		position.z = z;
//		//position.x += getTargetX(targPos2);
//	}
//	else
//	{
//		System.out.println("Failure in target tracker, unitnited position line 372");
//	}
//	return position;
//}
//
//Position getRobotPosition(int targPos)
//{
//	Position robotPosition = new Position();
//	Target target = targets[targPos];
//
//	robotPosition.x = Math.sin(target.azimuth)*target.distance;
//	robotPosition.z = Math.cos(target.azimuth)*target.distance;
//	robotPosition.x += getTargetX(targPos);
//	double targetAzimuth = MathUtils.atan2(robotPosition.x, robotPosition.z) + Math.PI;
//	double camAzimuth = targetAzimuth - target.cameraAngle;
//	double camCos = Math.cos(camAzimuth);
//	double camSin = Math.sin(camAzimuth);
//
//	robotPosition.x -= Definitions.CAMERA_PARALLEL_OFFSET * camSin + Definitions.CAMERA_PERPENDICULAR_OFFSET * camCos;
//	robotPosition.z -= Definitions.CAMERA_PARALLEL_OFFSET * camCos - Definitions.CAMERA_PERPENDICULAR_OFFSET * camSin;
//
//	return robotPosition;
//
//}
//
//LaunchInfo getLaunchVelocity(Position robot, int target, boolean swish){
//	LaunchInfo launchInfo = new LaunchInfo();
//	double xHoop, yHoop, zHoop;
//	double deltaX, deltaY, deltaZ;
//	double floorDist, floorVelocity;
//	double initVertVelocity;
//	double tangentEntryAngle;
//	double travelTime;
//	xHoop = getTargetX(target);
//	yHoop = getTargetY(target)/*target height*/ - Definitions.DELTA_HEIGHT;
//	zHoop = swish ? Definitions.HOOP_OFFSET : -Definitions.HOOP_OFFSET;
//	//double angleToTarget = atan2(-robot.x, -robot.z);
//	deltaX = xHoop - robot.x;
//	deltaY = yHoop - Definitions.CAMERA_HEIGHT;
//	deltaZ = zHoop - robot.z;
//	//double angleToHoop = atan2(deltaX, deltaZ);
//
//	floorDist = Math.sqrt(deltaX*deltaX+deltaZ*deltaZ);
//	tangentEntryAngle = Math.tan(Definitions.DESIRED_ENTRY_ANGLE);
//	floorVelocity = Math.sqrt((Definitions.GRAVITY/2)*floorDist/(tangentEntryAngle
//			+ deltaY/floorDist));
//	travelTime = floorDist/floorVelocity;
//	initVertVelocity = Definitions.GRAVITY/2 * travelTime + deltaY/travelTime;
//	launchInfo.LaunchSpeed = Math.sqrt(floorVelocity*floorVelocity + initVertVelocity*initVertVelocity);
//	launchInfo.LaunchVerticalAngle = MathUtils.atan2(initVertVelocity,floorVelocity);
//	//horizontal angle
//	if(targets[target].initialized)
//        {
//		launchInfo.HorizAngleError = targets[target].cameraAngle;
//        }
//	else if(target == Target.TARGET_TOP && targets[Target.TARGET_BOTTOM].initialized)
//        {
//		launchInfo.HorizAngleError = targets[Target.TARGET_BOTTOM].cameraAngle;
//        }
//	else if(target == Target.TARGET_BOTTOM && targets[Target.TARGET_TOP].initialized)
//        {
//		launchInfo.HorizAngleError = targets[Target.TARGET_TOP].cameraAngle;
//        }
//	else
//        {
//		launchInfo.HorizAngleError = 0;
//        }
//
//	//launchInfo.ConfidenceLevel = confidence; //TODO: Implement shooting confidence!!!
//	return launchInfo;
//}
//
//LaunchInfo getLaunchVelocityNoCam(Position robot, int target, boolean swish){
//	//no camera input
//	LaunchInfo launchInfo = new LaunchInfo();
//		double xHoop, yHoop, zHoop;
//		double deltaX, deltaY, deltaZ;
//		double floorDist, floorVelocity;
//		double initVertVelocity;
//		double tangentEntryAngle;
//		double travelTime;
//		xHoop = getTargetX(target);
//		yHoop = getTargetY(target)/*target height*/ - Definitions.DELTA_HEIGHT;
//		zHoop = swish ? Definitions.HOOP_OFFSET : -Definitions.HOOP_OFFSET;
//		//double angleToTarget = atan2(-robot.x, -robot.z);
//		deltaX = xHoop - robot.x;
//		deltaY = yHoop - Definitions.CAMERA_HEIGHT;
//		deltaZ = zHoop - robot.z;
//		//double angleToHoop = atan2(deltaX, deltaZ);
//
//		floorDist = Math.sqrt(deltaX*deltaX+deltaZ*deltaZ);
//		tangentEntryAngle = Math.tan(Definitions.DESIRED_ENTRY_ANGLE);
//		floorVelocity = Math.sqrt((Definitions.GRAVITY/2)*floorDist/(tangentEntryAngle
//				+ deltaY/floorDist));
//		travelTime = floorDist/floorVelocity;
//		initVertVelocity = Definitions.GRAVITY/2 * travelTime + deltaY/travelTime;
//		launchInfo.LaunchSpeed = Math.sqrt(floorVelocity*floorVelocity + initVertVelocity*initVertVelocity);
//		launchInfo.LaunchVerticalAngle = MathUtils.atan2(initVertVelocity,floorVelocity);
//		launchInfo.HorizAngleError = 0; //+ (angleToHoop - angleToTarget);// - angleOffset - M_PI;//azimuth - angleOffset - M_PI;
//		//launchInfo.ConfidenceLevel = confidence - 5; //TODO: Implement shooting confidence!!!
//		return launchInfo;
//}
//
//double getTargetX(int targPos)
//{
//	switch(targPos)
//	{
//	case Target.TARGET_RIGHT:
//		return Definitions.TARGET_RHT_X;
//	//break;
//
//	case Target.TARGET_BOTTOM:
//	case Target.TARGET_TOP:
//		return Definitions.TARGET_MID_X;
//	//break;
//
//	case Target.TARGET_LEFT:
//		return Definitions.TARGET_LFT_X;
//	//break;
//
//	default:
//		return 0.0;
//	//break;
//	}
//}
//
//double getTargetY(int targPos)
//{
//	switch(targPos)
//	{
//	case Target.TARGET_TOP:
//		return Definitions.TARGET_TOP_Y;
//	//break;
//
//	case Target.TARGET_RIGHT:
//	case Target.TARGET_LEFT:
//		return Definitions.TARGET_MID_Y;
//	//break;
//
//	case Target.TARGET_BOTTOM:
//		return Definitions.TARGET_BOT_Y;
//	//break;
//
//	default:
//		return 0.0;
//	//break;
//	}
//}
//}
